package com.love.common.exception;

import com.love.common.enums.ResultCodeEnum;
import com.love.common.util.RespUtil;
import com.love.common.vo.RespResultVO;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * TODO description
 *
 * @author sunbo
 * @date 2021/5/13 上午11:42
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(value = Exception.class)
    public RespResultVO handle(Exception e) {
        e.printStackTrace();
        return RespUtil.fail(ResultCodeEnum.INTERNAL_ERROR);
    }

}
